<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script src="${ctx}/common/plateform/base/jquery/jquery.cookie.js"></script>
<script src="${ctx}/common/base/tools-login.js"></script>

<c:if test="${empty loginUser}">
	<a href="javascript:void(0);" class="user_land" onclick="toLogin();">登录</a> &nbsp;&nbsp;
	<a href="javascript:void(0);" onclick="toReg();">注册</a> &nbsp;&nbsp;
</c:if>
<c:if test="${!empty loginUser}">
	欢迎您&nbsp;<input type="hidden" name="top_login_frame_user_ename" value="${loginUser.userEname}"/>
	<input type="hidden" name="top_login_frame_user_cname" value="${loginUser.userCname}"/>
	<input type="hidden" name="top_login_frame_user_id" value="${loginUser.userId}"/>
	<input type="hidden" name="top_login_frame_user_type" value="${loginUser.userType}"/>
	<input type="hidden" name="top_login_frame_user_customer_type" value="${loginUser.user.customerType}" />
	<input type="hidden" name="top_login_frame_user_act" value='${loginUser.actJsonStr}'/>
	<c:if test="${loginUser.userType =='manager' || loginUser.userType =='broker'}">
		<a class="w_changeLine w_head_col" href="javascript:void(0);" onclick="toUserManager('/admin/index-manager')" title="进入管理中心"><i class="fa fa-user fx8" style="color:#999;"></i> ${loginUser.userCname}</a>
	</c:if>
	<c:if test="${loginUser.userType =='customer' }">
		<a class="w_changeLine w_head_col" href="javascript:void(0);" onclick="toUserManager('/web/user/index')" title="进入用户中心"><i class="fa fa-angle-double-right fx8" style="color:#999;"></i> ${loginUser.userCname}</a>
	</c:if>
	&nbsp;&nbsp;
	<a href="javascript:void(0);" class="w_head_col" onclick="logoutIndex('/')"><i class="fa  fa-dot-circle-o fx8" style="color:#999;"></i> 退 出</a>
	&nbsp;&nbsp;
</c:if>

<script>
function toReg(){
	//window.location.href=ctx+"/wcm/cacec/html/register.html";
    window.open(ctx+"/wcm/cacec/html/register.html");
}
function toLogin(){
	loginIndex(sysName);
}
function toUserManager(flagURL){
    window.open(ctx+"/sendPage/"+sysName+flagURL);
}

</script>